//
//  UIButton+Extension.swift
//  新浪微博01
//
//  Created by yaochunlin on 16/4/15.
//  Copyright © 2016年 yaochunlin. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(imageName:String, bgImageView:String = "timeline_card_bottom_background", title:String) {
    
        self.init(frame: CGRectZero)
        
        //设置按钮背景
        setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background"), forState: UIControlState.Normal)
        setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background_highlighted"), forState: UIControlState.Highlighted)
        //设置按钮图片
        setImage(UIImage.init(named: imageName), forState: UIControlState.Normal)
        
        //设置按钮标题
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(YCLStatusTimeFontSize)
    }
}
